<div class="layui-form layui-form-pane mine-view">
    <ul class="app-bind">

        <li class="fly-msg  {$myInfo['mobile']?'app-havebind':''}">
            <i class="layui-icon layui-icon-cellphone-fine"></i>
            {empty name="$myInfo['mobile']"}
            <a href="javascript:" class="acc-bind" type="mobile">立即绑定</a>
            <span>，即可使用手机号登录{$site_name}</span>
            {else/}

            <span>已成功绑定 {$myInfo.mobile|hide_mobile}，您可以使用手机号直接登录{$site_name}，当然，您也可以</span>
            <a href="javascript:" class="acc-unbind" type="mobile">解除绑定</a>

            {/empty}

        </li>


        <li class="fly-msg  {$myInfo['email']?'app-havebind':''}">
            <i class="layui-icon  layui-icon-email"></i>
            {empty name="$myInfo['email']"}
            <a href="javascript:" class="acc-bind" type="email">立即绑定</a>
            <span>，即可使用邮箱登录{$site_name}</span>
            {else/}

            <span>已成功绑定 {$myInfo.email|hide_email}，您可以使用邮箱直接登录{$site_name}，当然，您也可以</span>
            <a href="javascript:" class="acc-unbind" type="email">解除绑定</a>

            {/empty}

        </li>

        {:hook('user_setting')}

    </ul>
</div>

<script>


    $(function () {
        //帐号绑定
        $('.acc-unbind').on('click', function () {
            var othis = $(this), type = othis.attr('type');
            layer.confirm('真的的要解绑' + ({
                mobile: '手机',
                email: '邮箱',
                weixin: '微信',
                qq: 'QQ'
                , weibo: '微博'
            })[type] + '吗？', {icon: 5}, function () {

                $.post("{:url('user/setting/unbind')}", {type:type}, function (res) {
                    ajax_result(res)
                })

            });
        });


    })
</script>